load("//bindings/pydrake:pydrake.bzl", "add_lint_tests_pydrake")
load(
    "//tools/skylark:drake_py.bzl",
    "drake_py_library",
    "drake_py_unittest",
)
load(
    "//tools/skylark:pybind.bzl",
    "drake_pybind_library",
    "get_pybind_package_info",
)

package(default_visibility = [
    "//bindings/pydrake:__subpackages__",
    "//tools/workspace/drake_models:__pkg__",
])

# This determines how `PYTHONPATH` is configured.
PACKAGE_INFO = get_pybind_package_info("//bindings")

drake_py_library(
    name = "module_py",
    testonly = 1,
    srcs = ["__init__.py"],
    imports = PACKAGE_INFO.py_imports,
    deps = [
        "//bindings/pydrake/common",
    ],
)

drake_pybind_library(
    name = "autodiffutils_test_util_py",
    testonly = True,
    add_install = False,
    cc_deps = [
        "//bindings/pydrake:autodiff_types_pybind",
    ],
    cc_so_name = "autodiffutils_test_util",
    cc_srcs = ["autodiffutils_test_util_py.cc"],
    package_info = PACKAGE_INFO,
)

drake_py_library(
    name = "deprecation_py",
    testonly = 1,
    srcs = ["deprecation.py"],
    deps = [":module_py"],
)

drake_py_library(
    name = "meta_py",
    testonly = 1,
    srcs = ["meta.py"],
    deps = [":module_py"],
)

drake_py_unittest(
    name = "meta_test",
    deps = [
        ":meta_py",
    ],
)

drake_py_library(
    name = "numpy_compare_py",
    testonly = 1,
    srcs = ["numpy_compare.py"],
    deps = [
        ":module_py",
        "//bindings/pydrake:polynomial_py",
    ],
)

drake_py_library(
    name = "pickle_compare_py",
    testonly = 1,
    srcs = ["pickle_compare.py"],
    deps = [
        ":module_py",
        ":numpy_compare_py",
    ],
)

# Package roll-up (for Bazel dependencies).
drake_py_library(
    name = "test_utilities",
    testonly = 1,
    deps = [
        ":autodiffutils_test_util_py",
        ":deprecation_py",
        ":meta_py",
        ":module_py",
        ":numpy_compare_py",
        ":pickle_compare_py",
    ],
)

add_lint_tests_pydrake()
